<!DOCTYPE html>
    <html lang="en">
    <head>
        <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
    <style>
    img{width: 200px;height: 300px;display: block;position: absolute;}
    .div1{width: 200px;height: 300px;background:#2A2A2A;opacity: 0.7;color: white;}
    </style>
</head>
<body>
    <img src="./imgs/p15.jpg" alt="">
    <script>
        function imgChange(){
    var imgs=document.querySelector("img");
    imgs.onmouseover=function(){
    var divs=document.createElement("div");
    divs.className="div1";
    divs.innerHTML=`<h3>故宫</h3><p>世界五大宫之首</p>  `
    document.body.appendChild(divs);
    divs.style.left=imgs.offsetLeft;
    divs.style.top=imgs.offsetTop;    
}
    }
        </script>
    </body>
    </html>